<?php

class PCLinkHash {

  protected static $_instance;
  protected $hashArray;
  protected $strIndexPage = "index.php";

  private function __construct() {
    $this->hashArray = array();
    $this->hashArray[md5($this->strIndexPage)] = $this->strIndexPage;
  }

  private function __clone() {
  }


  public static function getInstance() {
   if(null === self::$_instance) {
     self::$_instance = new self();
   }
   return self::$_instance;
  }

        
  public function getStartPageKey() {
    return md5($this->strIndexPage);
  }

  public function getStartPage() {
    return $this->strIndexPage;
  }

  public function getPageHash($str) {
    return md5($str);
  }

  public function addPage($page_name) {
    $this->hashArray[md5($page_name)] = $page_name;
  }

  public function getPage($page_hash) {
    return $this->hashArray[$page_hash];
  }

}

?>
